﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：吕海乐 
    //
    // 文件名：BidProductList.cs
    // 文件功能描述：采购产品管理：采购产品列表
    // 创建标识：吕海乐2009-03-19
    //
    // 修改标识：
    // 修改描述：
    //
    // 修改标识：
    // 修改描述：
    //
    // 审核人：
// 审核时间：
// 审核说明：
 //----------------------------------------------------------------*/
using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;
using HZ.DrugTrade.Web;
using HZ.DrugTrade.Model;
using HZ.DrugTrade.IBLL;
using HZ.DrugTrade.BLLFactory;
using HZ.DrugTrade.Model.Enum;

namespace HZ.DrugTrade.Web.Admin
{
    public partial class AreaProductList : BasePage
    {
        IBLL_ProcurementBasic pbCtrl = Factory.BLL_ProcurementBasic();
        IBLL_ProcurementBasic ipb = Factory.BLL_ProcurementBasic();
        IBLL_Area Area = Factory.BLL_Area();
        string procureCatalogId = "";
        
        public AreaProductList()
        {
            //this.ModuleNo = Module.采购产品管理.ToString();//报错临时删除
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                if (Request["procureCatalogId"] == null)
                {
                    PageError("参数错误！", this.ReturnUrl);
                    return;
                }
                procureCatalogId = Request["procureCatalogId"].ToString();

                Model.View.ProcureCatalog procureCatalog = ipb.GetProcureCatalogByID(procureCatalogId);
                if (procureCatalog != null)
                {
                    txtCompany_SC.Text = procureCatalog.CompanyName_SC;
                    txtCompany_TB.Text = procureCatalog.CompanyName_TB;

                    //txtFactor.Text = procureCatalog.Factor.ToString();
                    txtGoodsName.Text = procureCatalog.GoodsName;
                    txtMaterial.Text = procureCatalog.Material;
                    txtOutLook.Text = procureCatalog.Outlookc;
                    txtProject.Text = procureCatalog.ProjectName;
                    //txtSort.Text = procureCatalog.SortName;
                    txtUnit.Text = procureCatalog.Unit;
                }
                //只有中心账号才能查看
                if (CurrentAccount.GetUser().UserRole.RoleID != "03" || CurrentAccount.GetUser().Org.OrgID != "1")
                {
                    PageError("权限不足,只有中心才可查看！", this.ReturnUrl);
                    return;
                }

                //绑定列表
                setBind();
            }
        }


        private void setBind()
        {
            try
            {
                DataTable procureCatalogList = ipb.GetAreaProductList(procureCatalogId);
                gvwProduceCatalog.DataSource = procureCatalogList;
                gvwProduceCatalog.DataBind();

            }
            catch (Exception ex)
            {
                PageError(ex.Message, "");
            }
            
        }

       
       
      


       
    }
}
